
public class Fetcher {

	public String nextInstruction(int addressOfInstruction) {
		String s = RAM.read(addressOfInstruction);
		s = Convert.hexToBinary(s);
		return s;
	}
	
	public String nextInstruction(Page page, int offset, Process p){
		String s = null;
		if(page.present){
			s = MemoryManager.Read(page.frame, offset, p, page);
			s = Convert.hexToBinary(s);
			return s;
		}
		else
			if(MemoryManager.Fault(page, p))
				return nextInstruction(page, offset, p);
			else{
				System.out.println("Setting null instruction");
				return null;
			}
				
	}

}
